#!/bin/bash
#--20211018
# support NeoKylin-desktop-6.0,NeoKylin-server-6.5,rhel-6.5,Ubuntu
user="`who am i | awk -F" " '{print $1}'`"

source ../os/os_release.sh

lib_path="../../lib"
lib_other_path="${lib_path}/other"
lib_bak_path="${lib_path}/bak"
#echo `pwd`
function f_cutlib() {
	if [ ! -d ${lib_bak_path} ] ; then
	  mkdir ${lib_bak_path}
	fi
	mv ${lib_other_path}/libcurl* ${lib_bak_path}
	chown -R ${user} ${lib_bak_path}
}

if [ "${NAME}" = "Red Hat Enterprise Linux Server" ]; then
  if [ "${VERSION_ID}" > "6.9" ] ; then
    echo "now cut lib**** to bak for redhat >=7"
    f_cutlib 
  fi
elif [ "${NAME}" = "Ubuntu" ] ; then

  if [ "${VERSION_ID}" > "13.10" ]; then
    echo "now cut lib**** to bak for Ubuntu >=14.4"
    f_cutlib 
  fi
fi
